// pages/registration/registration.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    listData:[
      {"code":"01","xm":"wen","text":"text1","type":"type1"},
      {"code":"02","xm":"wen","text":"text2","type":"type2"},
      {"code":"03","xm":"wen","text":"text3","type":"type3"},
      // {"code":"04","xm":"wen","text":"text4","type":"type4"},
      // {"code":"05","xm":"wen","text":"text5","type":"type5"},
      // {"code":"06","xm":"wen","text":"text6","type":"type6"},
      // {"code":"07","xm":"wen","text":"text7","type":"type7"}
      ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    wx.request({
      url: app.globalData.api + 'reserve/',
      data: {},
      method: 'GET', 
      header: { cookie: app.globalData.header },
      success: function(res){
        // success
        console.log(res)
        that.setData({
          listData: res.data
        })
        
      },
     
    })

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})